<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <?php
        $cs = Yii::app()->getClientScript();
        $baseUrl = Yii::app()->request->baseUrl;
        $cs->registerCssFile($baseUrl . '/css/contact.css');
        $cs->registerCssFile($baseUrl . '/css/contact-form.css');
        ?>
        <style type="text/css">
            h4{
                text-align:left;
                color: #000;
            }
            td{
                text-align: left !important;
            }
        </style>
    </head>
    <body>
        <div id="body_main">
            <div id="contact">

                <?php if (Yii::app()->user->hasFlash('checkout')): ?>
                    <div class="flash-success" style="padding-top: 10px;padding-bottom: 10px;">
                        <?php echo Yii::app()->user->getFlash('checkout'); ?>
                    </div>
                <?php else: ?>
                    <div id="checkout_result" style="text-align: center; margin-bottom: 10px;">
                    </div>
                    <div class="form" id="checkout_f">
                        <?php
                        $form = $this->beginWidget('CActiveForm', array(
                            'id' => 'checkout-form',
                            'action' => 'checkout',
                            'enableClientValidation' => true,
                            'clientOptions' => array(
                                'validateOnSubmit' => true,
                            ),
                                ));
                        ?>
                        <p class="note"><?php echo Yii::t('default', 'fieldsWith'); ?> <span class="required">*</span> <?php echo Yii::t('default', 'areRequired'); ?>.</p>

                        <?php echo $form->errorSummary($model); ?>

                        <div class="row">
                            <?php echo $form->hiddenField($model, 'id', array('type' => "hidden", 'value' => $userInfo->id)); ?>
                        </div>
                        <div class="row">
                            <?php echo $form->labelEx($model, 'email'); ?>
                            <?php echo $form->textField($model, 'email', array('value' => $userInfo->email, 'size' => 40, 'maxlength' => 255)); ?>
                            <?php echo $form->error($model, 'email'); ?>
                        </div>

                        <div class="row">
                            <?php echo $form->labelEx($model, 'name'); ?>
                            <?php echo $form->textField($model, 'name', array('value' => $userInfo->name, 'size' => 40, 'maxlength' => 255)); ?>
                            <?php echo $form->error($model, 'name'); ?>
                        </div>

                        <div class="row">
                            <?php echo $form->labelEx($model, 'address'); ?>
                            <?php echo $form->textField($model, 'address', array('value' => $userInfo->address, 'size' => 40, 'maxlength' => 255)); ?>
                            <?php echo $form->error($model, 'address'); ?>
                        </div>

                        <div class="row">
                            <?php echo $form->labelEx($model, 'phone'); ?>
                            <?php echo $form->textField($model, 'phone', array('value' => $userInfo->phone, 'size' => 40, 'maxlength' => 255)); ?>
                            <?php echo $form->error($model, 'phone'); ?>
                        </div>
                        <div style="margin-top: 10px;">

                        </div>
                        <div class="row buttons">
                            <?php // echo CHtml::submitButton(Yii::t('default', 'purchase')); ?>
                            <a id="btn_purchase" class="btn btn-warning add_to_cart_btn" data-toggle="modal" href="#"><?php echo Yii::t('default', 'purchase'); ?></a>
                        </div>

                        <?php $this->endWidget(); ?>
                    </div><!-- form -->

                <?php endif; ?>
            </div>
        </div>
    </body>
</html>
